package com.campusbackend.entity.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;

import java.util.List;

/**
 * 用户信息更新请求VO
 * 
 * @author yezi
 * @since 2025-07-27
 */
@Data
@Schema(name = "UserUpdateRequestVO", description = "用户信息更新请求对象")
public class UserUpdateRequestVO {
    
    @Schema(description = "用户ID", required = true)
    @NotNull(message = "用户ID不能为空")
    private Long id;
    
    @Schema(description = "用户类型：1-教师，2-学生", required = true)
    @NotNull(message = "用户类型不能为空")
    private Integer userType;
    
    @Schema(description = "真实姓名", required = true)
    @NotBlank(message = "真实姓名不能为空")
    @Pattern(regexp = "^\\S{1,100}$", message = "姓名长度必须在1-100个字符之间")
    private String realName;
    
    @Schema(description = "手机号", required = false)
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号格式")
    private String phone;
    
    @Schema(description = "邮箱", required = true)
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "请输入正确的邮箱格式")
    private String email;
    
    @Schema(description = "学院（学生专用）", required = false)
    private String college;
    
    @Schema(description = "专业职位（教师专用）", required = false)
    private String professionalTitle;
    
    @Schema(description = "年龄（学生专用）", required = false)
    @Min(value = 16, message = "年龄不能小于16岁")
    @Max(value = 100, message = "年龄不能大于100岁")
    private Integer age;
    
    @Schema(description = "身份证号（教师专用）", required = false)
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$", 
             message = "请输入正确的身份证号格式")
    private String idCard;
    
    @Schema(description = "技能ID列表（学生专用）", required = false)
    private List<Long> skillIds;

    @Schema(description = "技能名称列表（学生专用）", required = false)
    private List<String> skills;
}
